SPRINGBOOT_APPNAME=cloud-provider-payment
TARGETPATH=/root/.jenkins/workspace/cloud-provider-payment-parent/cloud-provider-payment/target/
DOCKERFILEPATH=/root/.jenkins/workspace/cloud-provider-payment-parent/buildfile/Dockerfile
CURRENT_CREATE_TIME=`date +"%Y%m%d-%H%M%S"`

cd $TARGETPATH

docker build -f $DOCKERFILEPATH -t $SPRINGBOOT_APPNAME:$CURRENT_CREATE_TIME .
echo "DOCKER BUILD SUCCESS"

docker tag $SPRINGBOOT_APPNAME:$CURRENT_CREATE_TIME 192.168.157.141:5000/$SPRINGBOOT_APPNAME:$CURRENT_CREATE_TIME

docker push 192.168.157.141:5000/$SPRINGBOOT_APPNAME:$CURRENT_CREATE_TIME

echo "DOCKER PUSH SUCCESS"